home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Happle / Happlev5.sit / Happle#05 / Happle Issue#05.rsrc / TEXT_131.txt < prev    next >
Text File  |  1998-10-07  |  19KB  |  574 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                         Learning Unix
  8.             
  9.         Strap on your crash helmet, as PP takes us on a whirlwind tour of the world's most user friendly (natch) operating system
  10.  
  11. This file will tell you most of what you need to do to get on,  and navigate around a unix system.
  12.  
  13. First off, you should have a few essential pieces of software:
  14.  
  15. ‚Ä¢    Better Telnet - A telnet application. 
  16.  
  17. ‚Ä¢    Blacknight - A terminal dialer (this lets you dial into other systems)
  18.  
  19. ‚Ä¢    As many text files as you can
  20.  
  21. [Take a look at the links page towards the back for some useful starting points - Ed]
  22.  
  23. If you can get a hold of the following files, I strongly recommend you read them:
  24.  
  25. UNIX
  26.  
  27. Hacking Unix
  28. Basic Unix
  29.  
  30. Hacking
  31.  
  32. ‚Ä¢    All of the regular newbie guides
  33. ‚Ä¢    The 2600 Hack Faq.
  34. ‚Ä¢    Hackers Handbook
  35. ‚Ä¢    The LOD's 'A novice's guide to hacking' text
  36. ‚Ä¢    Every issue of HackAddict
  37. ‚Ä¢    Phrack magazine (there are currently 53 issues, so sift through them to find the relevant information)
  38.  
  39. Contents
  40.  
  41. 1 - Connecting to the other system
  42. 2 - Unix Commands
  43. 3 - Default Unix logins
  44. 4 - Getting the Passwords
  45. 5 - Sending anonymous email
  46.  
  47. Chapter 1 - Connecting to the other system
  48.  
  49. In this chapter we will use Telnet and Black Night
  50.  
  51. Connecting is simple - go to the file menu and choose 'Open connection...' First up, try your isp's domain name (ie Maclink.net is the maclink address).  If it connects you (a window will open),  it will give you a login prompt like this (at least it will if it's Unix):
  52.  
  53. login:
  54.  
  55. Type the login that you use to connect to your ISP
  56.  
  57. password:
  58.  
  59. And type your ISP password. If it lets you on,  it will then give you a whole bunch of crap welcoming you,  then it might tell you that you have mail,  and finally it will give you the prompt $:
  60.  
  61. you have mail
  62. $
  63.  
  64. the $ is your commands prompt.  If that all happened as it should have,  you are now free to play on a unix system.  On your isp's system,  you are free to do what you like...this is where you learn...
  65.  
  66. Chapter 2 - Unix Commands
  67.  
  68. Have fun with these...
  69. I took most of them out of other files cuz i'm too  lazy to type my own
  70.  
  71. Command                               Description
  72.  
  73.  
  74. awk                 Search for a pattern within a file. Includes
  75.                                              a built-in programming language.
  76.  
  77. bdiff                Compares two large files.
  78.  
  79. bfs                 Scans a large file.
  80.  
  81. cal                Displays a calendar.
  82.  
  83. cat                 Concatenates and prints files.
  84.  
  85. cc                  C  compiler.
  86.  
  87. cd                  Change directory.
  88.  
  89. chgrp                 Changes a file's group ownership.
  90.  
  91. chmod                 Changes a file's access permissions.
  92.  
  93. chown                 Changes the individual ownership of a file.
  94.  
  95. cmp                  Compares two files; diplays the location (line
  96.                             and byte) of the 1st difference between these.
  97.  
  98. comm                  Compares two files so as to determine which
  99.                             lines are common to both.
  100.  
  101. cp                   Copies a file to another location.
  102.  
  103. cu                   Calls another UNIX system.
  104.  
  105. date                  Returns the date and time.
  106.  
  107. df                   Displays free space in the file system.
  108.  
  109. diff                  Displays the differences between two files
  110.                             or directories.
  111.  
  112. diff3                 Displays the differences between three files
  113.                             or directories.
  114.  
  115. du                   Reports on file system usage.
  116.  
  117. echo                  Displays its argument.
  118.  
  119. ed                   Text editor.
  120.  
  121. ex                   Text editor.
  122.  
  123. expr                  Evaluates its argument which is generally
  124.                            a mathematical formula.
  125.  
  126. f77                  FORTRAN compiler.
  127.  
  128. find                  Locates the files w/ specified characteristics.
  129.  
  130. format                Initializes a floppy disk.
  131.  
  132. grep                  Searches for a pattern within a file. (see awk)
  133.  
  134. help                  Salvation.
  135.  
  136. kill                  Ends a process.
  137.  
  138. ln                   Used to link files.
  139.  
  140. lpr                  Copies the file to the line printer.
  141.  
  142. ls                   Displays info. about one or more files.
  143.  
  144. mail                 Used to receive or deliver e-mail.
  145.  
  146. mkdir                 Creates a new directory.
  147.  
  148. more                 Displays a long file so that the user
  149.                             can scroll through it.
  150.  
  151. mv                  Used to move or rename files.
  152.  
  153. nroff               Used to format text.
  154.  
  155. ps                  Display a process's status.
  156.  
  157. pwd                 Display the name of the working directory.
  158.  
  159. rm                  Removes one or more files.
  160.  
  161. rmdir               Deletes one or more directories.
  162.  
  163. sleep               Causes a process to become inactive for a
  164.                            specified length of time.
  165.  
  166. sort                Sort and merge one or more files.
  167.  
  168. spell               Finds spelling errors in a file.
  169.  
  170. split               Divides a file.
  171.  
  172. stty                Display or set terminal parameters.
  173.  
  174. tail                Displays the end of a file.
  175.  
  176. troff               Outputs formatted output to a typesetter.
  177.  
  178. tset                Sets the terminal type.
  179.  
  180. umask               Allows the user to specify a new creation
  181.                             mask. 
  182.  
  183. uniq                Compares 2 files. Finds and displays lines
  184.                             in one file that are unique.
  185.  
  186. uucp                UNIX-to-UNIX execute.
  187.  
  188. vi                 Full screen editor.
  189.  
  190. wc                 Displays details in the file size.
  191.  
  192. who                 Information on who else is online.
  193.  
  194. write               Used to send a message to another user.
  195.  
  196.  
  197.    awk program filenames
  198.    awk -f programfilenames filenames
  199.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  200.    The [awk] utility can be used to find any lines in a file which 
  201.    match a certain pattern; once found, these lines can be processed.
  202.    In the first configuration, the program that [awk] is to
  203.    execute is specified in the command line. In the second,
  204.    the program is stored as the file given in programfilename.
  205.    The -f option instructs [awk] to read this file.
  206.  
  207.  
  208.    [bdiff] is used to compare files too large for [diff]. See
  209.    [diff] for the format.
  210.  
  211.  
  212.    bfs filename
  213.    ~~~~~~~~~~~~
  214.    [bfs] is used to scan a large file to determine where to split
  215.    it into smaller files.
  216.  
  217.  
  218.    cal 01-12 (month) 0-9999 (year)
  219.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  220.    [cal] utility can be used to display a calendar of any year
  221.    from 0 to 9999 AD, and any or all of the twelve months.
  222.  
  223.  
  224.    cat filename
  225.    ~~~~~~~~~~~~
  226.    [cat] can be used to examine a short file. See [more] for 
  227.    lengthier files.
  228.  
  229.  
  230.    number[cc]
  231.    ~~~~~~~~~~
  232.    The [cc] command changes the entire current line, or a group
  233.    of lines starting with the current line. [number] represents
  234.    the number of old lines to be deleted.
  235.  
  236.  
  237.    cd directory name
  238.    ~~~~~~~~~~~~~~~~~
  239.    The [cd] command causes the current working directory to be
  240.    changed. The [directory name] can be either a full or partial
  241.    path name.
  242.  
  243.  
  244.    chgrp groupname filename
  245.    ~~~~~~~~~~~~~~~~~~~~~~~~
  246.    This command changes the group ownership of a file.
  247.  
  248.  
  249.    chmod {ugoa} {+-} {rwx}
  250.    ~~~~~~~~~~~~~~~~~~~~~~~
  251.    The [chmod] utility changes a file's access permissions. [u]
  252.    specifies the user or owner's login name, [g] specifies a group
  253.    and [o] indicates all others. [a] indicates the user, group,
  254.    and all others; it's the default. [+] adds permission; [-]
  255.    deletes it. [r] indicates read, [w] write, and [x] execute.
  256.  
  257.  
  258.    chown individualname filename
  259.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  260.    [chown] changes the individual ownership of a file (see chgrp).
  261.  
  262.  
  263.    cmp filename1 filename2
  264.    ~~~~~~~~~~~~~~~~~~~~~~~
  265.    [cmp] is one of the four principle UNIX file comparison utilities.
  266.    It compares 2 files, and returns the positions where they differ.
  267.  
  268.  
  269.    comm -options filename1 filename2
  270.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  271.    The [comm] utility, in comparing two files, produces three
  272.    columns of output. The first contains lines unique to the
  273.    first file, the second, lines unique to the second, and the
  274.    third column, lines common to both files. By placing the
  275.    numbers [1], [2], and/or [3] in the [options] position, any
  276.    one (or more) of these columns can be suppressed.
  277.  
  278.  
  279.    cp sendingfile receivingfile
  280.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  281.    The [cp] command copies a file. [sendingfile] is the file to be
  282.    copied, [receivingfile] is the file to which it is copied.
  283.  
  284.  
  285.    diff [options] filename1 filename2
  286.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  287.    Again, a file comparison utility. However, with [diff], the 
  288.    differences are displayed as instructions that can be used
  289.    to edit the files so that they are identical.
  290.  
  291.  
  292.    diff3 filename1 filename2 filename3
  293.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  294.    Similar to [diff], [diff3] is unique in that it can compare
  295.    three files. Gee.
  296.  
  297.  
  298.    ed filename
  299.    ~~~~~~~~~~~
  300.    One of the UNIX's three editing utilities, [ed] is a basic line
  301.    editor. I'm sure there are other files that will explain how
  302.    to use [ed]. Thus, I'll confine myself to a rough outline:
  303.    e filename ........... edit a different file
  304.    f filename ........... changes the currently specified file.
  305.    h .................... provides explanation of errors.
  306.    I
  307.    text ................. inserts text before the current line.
  308.    line,linel ........... lists the specified lines.
  309.    line,linen ........... displays specified lines, preceded by
  310.                           their line numbers.
  311.    q .................... exit from [ed]
  312.    w .................... writes buffer to current filename.
  313.    + or - ............... +number of lines closer to end
  314.                           -number of lines closer to beginning.
  315.  
  316.  
  317.    expr formula
  318.    ~~~~~~~~~~~~
  319.    Utility which evaluates an expression.
  320.  
  321.  
  322.    find directory searchcriteria parameter actioncriteria parameter
  323.  
  324.    The [find] utility can be very useful indeed, especially when
  325.    confronted by a UNIX with countless files. Basically, this 
  326.    command finds files which meet certain criteria, and then
  327.    performs an operation (such as printing the files). Search
  328.    criteria consists of the following:
  329.  
  330.  
  331.    Criteria     Parameter       Description
  332.    ~~~~~~~~     ~~~~~~~~~       ~~~~~~~~~~~
  333.    -name       filename        Files whose names match [filename]
  334.                                will meet this criteria.
  335.    -type       filetype        Files whose type matches that specified
  336.             [b] block special                      will meet criteria.
  337.             [c] character spec. file
  338.             [d] directory file
  339.             [f] plain file
  340.    -links      +/- x           Files with # of links indicated by
  341.                                + or - x meet this criteria.
  342.    -user       login name      Files belonging to user with given
  343.             or user ID #       login name or ID # meet criteria.
  344.    -group      group name      Files belonging to group with given
  345.             or group ID #      group name or ID # meet this criteria.
  346.    -size       + or - x        Files greater than +x bytes or less
  347.                                than -x bytes meet this criteria.
  348.    -atime      + or - x        Files not accessed within +x days,
  349.                                accessed within -x days, or acc-
  350.                                essed x days ago meet criteria.
  351.    -mtime      + or - x        Files NOT modified within +x days,
  352.                                modified within -x days, or modified
  353.                                x days ago will meet this criteria.
  354.    -newer      filename        Files modified more recently than
  355.                                [filename] meet this criteria.
  356.   Action Criteria   "                    "
  357.   ~~~~~~~~~~~~~~~   ~                    ~
  358.    -print           -          When search criteria are met, path
  359.                                name of the file is displayed.
  360.    -exec       command{ }\;    Executes given command when search
  361.                                criteria are met. { } indicates file-
  362.                                name, [\;] ends the command.
  363.    -ok         command{ }\;    Exactly like -exec, except user is
  364.                                prompted [y] or [n] before command.
  365.  
  366.  
  367.    grep -options searchstring filenames
  368.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  369.    Another search command, this for a particular string of chars.
  370.  
  371.  
  372.    ln original new
  373.    ~~~~~~~~~~~~~~~
  374.    [ln] establishes a file link. For this utility, [original] repre-
  375.    sents the filename to be linked, [new] the filename of the new
  376.    link to the original.
  377.  
  378.  
  379.    [ls] provides directory information.  [ls -l/] displays a more
  380.    complete version of the info. list.
  381.  
  382.  
  383.    mail username username
  384.    ~~~~~~~~~~~~~~~~~~~~~~
  385.    This utility allows e-mail to be sent to other system users. 
  386.  
  387.    mail
  388.    ~~~~
  389.    Simply typing [mail] checks the user's own mailbox.
  390.    When sending mail, several items must be set:
  391.    ~s text ............ sets the subject field
  392.    ~c user names ...... sends other users carbon copies of mail
  393.    m user names ....... activates the compose mode, with the
  394.                         specified users as the message's recipients.
  395.    ~h ................. displays and allows editing of all headers.
  396.    ^D ................. ends message editing; sends mail.
  397.    ~r filename ........ places file in body of message (keen command)
  398.  
  399.    Reading One's Own Mail:
  400.    h number or range ....... causes specified headers to be displayed
  401.    p message # ............. displays entire message
  402.    d number or range ....... deletes specified messages
  403.    u number or range ....... undelete specified mail during SAME
  404.                              mail session (messages removed after q)
  405.    q ....................... leave the post office
  406.  
  407.  
  408.    mkdir directoryname
  409.    ~~~~~~~~~~~~~~~~~~~
  410.    [mkdir] allows creation of a subdirectory, for your dining 
  411.    enjoyment.
  412.  
  413.  
  414.    more filename
  415.    ~~~~~~~~~~~~~
  416.    For longer files, [more] is a convenient utility. It will display
  417.    the first screen of file data and then stop, allowing the user 
  418.    to control scrolling henceforth.
  419.  
  420.  
  421.    mv oldfilename newfilename
  422.    ~~~~~~~~~~~~~~~~~~~~~~~~~~
  423.    The [mv] utility can be used simply to rename a file, or...
  424.  
  425.  
  426.    mv filea fileb... directory
  427.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  428.    [mv] can also be used to move files to a new directory, provided
  429.    the directory exists, and you have write access to it.
  430.  
  431.  
  432.    ps -options
  433.    ~~~~~~~~~~~
  434.    The [ps] command, by itself, displays the status of each active
  435.    process controlled by your terminal. This status report includes
  436.    the Process Identification Number (PID), the terminal (TTY), the
  437.    time the process has been executing (TIME), and the command line
  438.    used to execute the process (CMD).
  439.    [ps]'s three options include -a (displays info. on active processes
  440.    controlled by any terminal), -x (info. on ALL active processes), and
  441.    -l (an extensive status report on all active processes).
  442.  
  443.  
  444.    pwd
  445.    ~~~
  446.    [pwd] command displays the present working directory.
  447.  
  448.  
  449.    rm filename
  450.    ~~~~~~~~~~~
  451.    [rm] removes a file. More than one file can be specified.
  452.  
  453.  
  454.    rmdir directoryname
  455.    ~~~~~~~~~~~~~~~~~~~
  456.    This utility removes a directory, an EMPTY directory (save the
  457.    hidden files). 
  458.  
  459.  
  460.    sleep seconds
  461.    ~~~~~~~~~~~~~
  462.    The [sleep] utility causes a process to become inactive for a
  463.    certain period of time. Max. seconds is 65,536 (about 18 hrs).
  464.  
  465.  
  466.    sort -options filenames
  467.    ~~~~~~~~~~~~~~~~~~~~~~~
  468.    [sort] merges and sorts files. Without options, [sort] orders
  469.    files by the ASCII codes of the characters at the beginning
  470.    of each line. Options include -b (leading blanks ignored), -d
  471.    (only letters, digs, and blanks considered; "dictionary sort"),
  472.    -f (case ignored), -n (numerical sort [for numerical data]), and
  473.    -r (a reverse sort).
  474.  
  475.  
  476.    split -size original resulting
  477.    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  478.    [split] divides a large file into smaller ones. [size] refers to
  479.    the number of lines the resulting files contain, [original] is
  480.    the name of the orig. file, and [resulting] represents the 
  481.    prefix name assigned to the newly created files.
  482.  
  483.  
  484.    umask ugo
  485.    ~~~~~~~~~
  486.    [umask] changes the file CREATION mask (see [chmod] for already
  487.    existing files). Here, [u] represents the owner's access 
  488.    permission, [g] the group's a.p., and [o] the a.p. for all others.
  489.  
  490.  
  491.    [uucp] (UNIX to UNIX copy) can be used to send files to a 
  492.    remote UNIX, or retrieve files from the remote system.
  493.    Other UNIX comm commands include [cu] (which establishes contact
  494.    with another system), and [uux] (UNIX to UNIX execute; allows
  495.    commands to be executed on a remote system).
  496.  
  497.  
  498.    wc -options filenames
  499.    ~~~~~~~~~~~~~~~~~~~~~
  500.    The [wc] utility displays file-size information. This includes
  501.    the number of lines, words, and characters. By chosing the 
  502.    -l, -w, or -c options, the information can be limited to only
  503.    line, word, or character number.
  504.  
  505.  
  506.    who
  507.    ~~~
  508.    A very useful command (which some systems respond to even before 
  509.    a user is actually logged on), [who] displays a list of users
  510.    currently online. This list includes the user's name, terminal
  511.    device # (tty), and the log-in time.  [who am i] displays info.
  512.    only on the user who executed the command.    
  513.  
  514. Chapter 3 - Default Unix Logins
  515.  
  516.    login:       Password:
  517.  
  518.    root         root,system,etc..
  519.    sys          sys,system
  520.    daemon       daemon
  521.    uucp         uucp
  522.    tty          tty
  523.    test         test
  524.    unix         unix
  525.    bin          bin
  526.    adm          adm
  527.    who          who
  528.    learn        learn
  529.    uuhost       uuhost
  530.    nuucp        nuucp
  531.     guest                    unpassworded
  532.  
  533. Chapter 4 - Getting the Passwords
  534.  
  535. One of the first things done on the system is print up or capture (in a buffer) the file containing all user names and accounts.  This can be done by issuing the following command:
  536.  
  537. cat /etc/passwd
  538.  
  539. If you are successful you will a list of all accounts on the system. It should look like this:
  540.  
  541. root:hvnsdcf:0:0:root dir:/:
  542. joe:majdnfd:1:1:Joe Cool:/bin:/bin/joe
  543. hal::1:2:Hal Smith:/bin:/bin/hal
  544.  
  545.   The "root" line tells the following info :
  546.  
  547. login name=root
  548. hvnsdcf   = encrypted password
  549. 0         = user group number
  550. 0         = user number
  551. root dir  = name of user
  552. /         = root directory
  553.  
  554. In the Joe login, the last part "/bin/joe " tells us which directory is his home directory (joe) is.
  555.  
  556. In the "hal" example the login name is followed by 2 colons, that means that there is no password needed to get in using his name.
  557.  
  558. Chapter 5 - Sending Anonymous E-mail
  559.  
  560. Get into the normal unix shell and type telnet. That should bring up the following prompt:
  561.  
  562. telnet>
  563.  
  564. type "open localhost 25". It should bring up a whole bunch of garbage, then type 
  565.  
  566. "mail". You will get more garbage. Ignore it and type "send to:xxxxx@xxxxx.xxx (whoever you want to send to)" 
  567.  
  568. type "rcpt to:xxxx@xxx.xxx (whoever you want the mail to appear from)". Now type the message by typing "data",  and then the message you want to send.  End it with a "." on a new line.
  569.  
  570. It will fool the average user,  but will cause suspition with sysops,  etc.
  571.  
  572.             -This has been a production of PP enterprises ¬©1998
  573.  
  574. Please send comments about this text and any additions you can think of to pp_123@Hotmail.com